package com.neuedu.spring.autowire;

import com.neuedu.spring.autowire.controller.UserController;
import com.neuedu.spring.autowire.service.UserService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppConfig {

    @Bean
    public UserController getUserController(UserService userService){
        //从容器中 获取一个
        return new UserController(userService);
    }



    @Bean
    public UserService getUserService(){
        return new UserService();
    }



}
